-
Notifications
You must be signed in to change notification settings - Fork 93
feat: replace isLevelEnabled guards with Pino interpolation values
#4679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: replace isLevelEnabled guards with Pino interpolation values
#4679
Conversation
Signed-off-by: nikolay <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
jasuwienas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's pretty straightforward! I wasn't sure whether we should use %s for an array, but it matches the current behavior where we inject the values directly into the string, so it's fine (${['']} === [''].toString()).
That said, these changes will heavily conflict with the work I did for the Redis refactor. (and which I didn't merge because of the newman issue): #4623
Perhaps we can leave the updates to RedisCache.ts out of this PR and handle them in a separate task? wdyt?
…ing-interpolation-when-logging
819aac1
Description
This PR implements a comprehensive logging performance optimization by replacing
isLevelEnabledguards with Pino's interpolation values (printf-style formatting) across the codebase. The current implementation uses JavaScript string interpolation within conditional guards, which causes performance overhead by building log messages even when the corresponding log level is disabled.Key improvements:
%sfor string interpolation and%ofor object interpolationRelated issue(s)
Fixes #4080
Testing Guide
Changes from original design (optional)
N/A
Additional work needed (optional)
N/A
Checklist